/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-07 13:44:18  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.bp.repository;

import com.joysuch.wwyt.bp.entity.BpEmergencyContingencyPlan;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;

import java.util.List;

/**
 * BpEmergencyContingencyPlanDao
 * 
 */
public interface BpEmergencyContingencyPlanDao
        extends JpaRepository<BpEmergencyContingencyPlan, Long>, QuerydslPredicateExecutor<BpEmergencyContingencyPlan> {
    public Page<BpEmergencyContingencyPlan> findAll(Specification<BpEmergencyContingencyPlan> spec, Pageable pageable);

    public BpEmergencyContingencyPlan save(BpEmergencyContingencyPlan bean);

    public void delete(BpEmergencyContingencyPlan bean);

    @Query("select name from BpEmergencyContingencyPlan where id = ?1")
    public String findPlanNameById(Long id);

    List<BpEmergencyContingencyPlan> findByName(String name);
}
